local skel = fk.CreateSkill {
  name = "rmt__minshi"
}

Fk:loadTranslationTable{
  ["rmt__minshi"] = "民视",
  [":rmt__minshi"] = "当你使用或打出红色伤害类基本或红色伤害类普通锦囊牌时，可以多指定一个目标或摸一张牌。",
  ["#rmt__minshi-draw"] = "民视:你可以摸一张牌。",
  ["#rmt__minshi-choose"] = "民视：你可以为%arg增加一个目标，不选则摸一张牌",

  ["$rmt__minshi1"] = "民之所欲，天必从之！民之视听，天必感之。",
  ["$rmt__minshi2"] = "惇信明义，崇德报功，垂拱而天下治。",
}

skel:addEffect(fk.CardResponding, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(skel.name)
    and data.card.color == Card.Red and data.card.is_damage_card
    and (data.card.type == Card.TypeBasic or data.card:isCommonTrick())
  end,
  on_cost = function (self, event, target, player, data)
    return player.room:askToSkillInvoke(player, {skill_name = skel.name, prompt = "#rmt__minshi-draw" })
  end,
  on_use = function (self, event, target, player, data)
    player:drawCards(1, skel.name)
  end,
})

skel:addEffect(fk.CardUsing, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(skel.name)
    and data.card.color == Card.Red and data.card.is_damage_card
    and (data.card.type == Card.TypeBasic or data.card:isCommonTrick())
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local targets = data:getExtraTargets({bypass_distances = true})
    if #targets > 0 then
      local tos = room:askToChoosePlayers(player, {
        targets = targets, min_num = 1, max_num = 1, skill_name = skel.name, cancelable = true,
        prompt = "#rmt__minshi-choose:::"..data.card:toLogString(),
      })
      if #tos > 0 then
        table.insert(data.tos, tos[1])
        return false
      end
    end
    player:drawCards(1, skel.name)
  end,
})

return skel
